<?php
use app\modules\clinical\models\Patient;
use app\models\Helpers;
use app\modules\clinical\models\ExcelEt;

$totalScore = 0;
foreach($model->excel->attributes as $key => $value) {
  if ($key == 'pk_id') continue;
	$totalScore += intval($value);
}

$pic = Helpers::checkExist("excel_et");

?>

  <!-- 第二部分 -->
  <tr class="title">
      <td colspan="4"><h4>一、患者信息与表格信息</h4></td>
  </tr>
  <tr>
      <th>姓名</th>
      <td>
        <?= ($model->rel_id == 0) ? Yii::$app->session->get('pt_name') : Patient::findOne(['pk_id'=>$model->pt_id])->pt_name ?>
      </td>
      <th>与患者关系</th>
      <td><?= ($model->rel_id == 0) ? '本人' : Patient::getParams('relation')[$rel[$model->pt_id]] ?></td>
  </tr>
  <tr>
      <th>创建人</th>
      <td><?= $model->crt_name ?></td>
      <th>创建时间</th>
      <td><?= $model->crt_time ?></td>
  </tr>
  <tr>
      <th>修改人</th>
      <td><?= $model->update_name ?></td>
      <th>修改时间</th>
      <td><?= $model->update_at ?></td>
  </tr>
  <tr>
    <th>评估日期</th>
    <td colspan="5"><?= $model->evaluation_time ?></td>
  </tr>
  <tr class="title">
      <td colspan="4"><h4>二、震颤评定量表</h4></td>
  </tr>

  <tr>
      <th>是否饮酒：</th>
      <td colspan="3"><?= ExcelEt::getParams('shifou', $model->excel->yinjiu) ?></td>
  </tr>
  <tr>
      <th>偏重侧：</th>
      <td><?= ExcelEt::getParams('zuoyou', $model->excel->pianzhongce) ?></td>
      <th>惯用手：</th>
      <td><?= ExcelEt::getParams('zuoyou', $model->excel->guanyongshou) ?></td>
  </tr>
  <tr>
      <th>震颤部位：</th>
      <td colspan="5"><?= ExcelEt::getZcClass($model->excel->zcleixing) ?></td>
  </tr>
  <tr><td colspan="5"></td></tr>

  <tr>
      <td></td>
      <th>左手</th>
      <th colspan="2">右手</th>
  </tr>
  <tr>
      <th width="350px">姿势性震颤（手平举）：</th>
      <td><?= $model->excel->zishi_l ?></td>
      <td colspan="2"><?= $model->excel->zishi_r ?></td>
  </tr>
  <tr>
      <th>指鼻试验：</th>
      <td><?= $model->excel->zhibi_l ?></td>
      <td colspan="2"><?= $model->excel->zhibi_r ?></td>
  </tr>
  <tr>
      <th>画阿基米德螺旋线（画在背面，标明左右手）：</th>
      <td><?= $model->excel->ajimi_l ?></td>
      <td colspan="2"><?= $model->excel->ajimi_r ?></td>
  </tr>
  <tr>
      <th>倒水：</th>
      <td><?= $model->excel->daoshui_l ?></td>
      <td colspan="2"><?= $model->excel->daoshui_r ?></td>
  </tr>
  <tr>
      <th>使用勺子：</th>
      <td><?= $model->excel->shaozi_l ?></td>
      <td colspan="2"><?= $model->excel->shaozi_r ?></td>
  </tr>
  <tr>
      <th>喝水：</th>
      <td><?= $model->excel->heshui_l ?></td>
      <td colspan="2"><?= $model->excel->heshui_r ?></td>
  </tr>

  <tr><td colspan="4"></td></tr>
  <tr>
    <th>总分：</th>
  	<td><?= $totalScore ?></td>
    <td rowspan="2" colspan="2" width="35%">
      <b>画阿基米德螺旋线：</b><br />
      <a href="<?= $pic['href'] ?>" target="_blank">
          <img <?= $pic['name'] ?> width="200px">
        </a>
    </td>
  </tr>
  <tr>
    <td colspan="2">
      0-3评分标准：<br />
      0无震颤<br />
      1轻度，幅度较小的震颤，不易察觉或间歇性出现<br />
      2中度，震颤幅度在1-2cm并持续性存在；活动时存在明显振动。<br />
      3重度，震颤幅度>2cm；激烈急促的震颤，导致难以完成活动，将水洒出，或不能用笔在纸上书写。
    </td>
  </tr>

